<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>固定定位</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        li {
            list-style: none;
        }

        div {
            width: 100px;
            height: 200px;
            background-color: #7ab5ee;

            position: fixed;
            top: 50%;
            right: 10%;
            transform: translate(50%,-50%);
        }

        body {
            height: 8000px;
        }
    </style>
</head>
<body>

<div>

</div>
</body>
</html>